package com.mengniu.commerce.admin.service.system.impl;

import java.util.List;

import com.mengniu.commerce.admin.domain.system.SysStoreSyncConfig;
import com.mengniu.commerce.admin.mapper.system.SysStoreSyncConfigMapper;
import com.mengniu.commerce.admin.service.system.ISysStoreSyncConfigService;
import com.mengniu.commerce.common.core.text.Convert;
import com.mengniu.commerce.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 店铺同步配置Service业务层处理
 *
 * @author fanwuZhou
 * @date 2023-11-21
 */
@Service
public class SysStoreSyncConfigServiceImpl implements ISysStoreSyncConfigService
{
    @Autowired
    private SysStoreSyncConfigMapper sysStoreSyncConfigMapper;

    /**
     * 查询店铺同步配置
     *
     * @param id 店铺同步配置主键
     * @return 店铺同步配置
     */
    @Override
    public SysStoreSyncConfig selectSysStoreSyncConfigById(Long id)
    {
        return sysStoreSyncConfigMapper.selectSysStoreSyncConfigById(id);
    }

    /**
     * 查询店铺同步配置列表
     *
     * @param sysStoreSyncConfig 店铺同步配置
     * @return 店铺同步配置
     */
    @Override
    public List<SysStoreSyncConfig> selectSysStoreSyncConfigList(SysStoreSyncConfig sysStoreSyncConfig)
    {
        return sysStoreSyncConfigMapper.selectSysStoreSyncConfigList(sysStoreSyncConfig);
    }

    /**
     * 新增店铺同步配置
     *
     * @param sysStoreSyncConfig 店铺同步配置
     * @return 结果
     */
    @Override
    public int insertSysStoreSyncConfig(SysStoreSyncConfig sysStoreSyncConfig)
    {
        sysStoreSyncConfig.setCreateTime(DateUtils.getNowDate());
        return sysStoreSyncConfigMapper.insertSysStoreSyncConfig(sysStoreSyncConfig);
    }

    /**
     * 修改店铺同步配置
     *
     * @param sysStoreSyncConfig 店铺同步配置
     * @return 结果
     */
    @Override
    public int updateSysStoreSyncConfig(SysStoreSyncConfig sysStoreSyncConfig)
    {
        sysStoreSyncConfig.setUpdateTime(DateUtils.getNowDate());
        return sysStoreSyncConfigMapper.updateSysStoreSyncConfig(sysStoreSyncConfig);
    }

    /**
     * 批量删除店铺同步配置
     *
     * @param ids 需要删除的店铺同步配置主键
     * @return 结果
     */
    @Override
    public int deleteSysStoreSyncConfigByIds(String ids)
    {
        return sysStoreSyncConfigMapper.deleteSysStoreSyncConfigByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除店铺同步配置信息
     *
     * @param id 店铺同步配置主键
     * @return 结果
     */
    @Override
    public int deleteSysStoreSyncConfigById(Long id)
    {
        return sysStoreSyncConfigMapper.deleteSysStoreSyncConfigById(id);
    }
}
